package Buffer2;

import java.util.Objects;

public class Student {

   private  String name;
   private int  age;
   private int  mathscore;
   private   int chinesescore ;

    public Student() {
    }

    public Student(String name, int age, int mathscore, int chinesescore) {
        this.name = name;
        this.age = age;
        this.mathscore = mathscore;
        this.chinesescore = chinesescore;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getMathscore() {
        return mathscore;
    }

    public void setMathscore(int mathscore) {
        this.mathscore = mathscore;
    }

    public int getChinesescore() {
        return chinesescore;
    }

    public void setChinesescore(int chinesescore) {
        this.chinesescore = chinesescore;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return age == student.age &&
                mathscore == student.mathscore &&
                chinesescore == student.chinesescore &&
                Objects.equals(name, student.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age, mathscore, chinesescore);
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", mathscore=" + mathscore +
                ", chinesescore=" + chinesescore +
                '}';
    }
}
